@extends('master/master_index')

@section('title')
    <title>个人动态</title>
@endsection

@section('css')
    <link rel="stylesheet" type="text/css" href="{{asset('home/css/msg.css')}}">
@endsection

@section('content')
    <div class="trends">
        <div class="trends_top">
            <i class="Hui-iconfont">&#xe6c9;</i>我的动态
        </div>
        @if(count($remind_my)>0)
            <ul class="answer trends_answer">
                @foreach($remind_my as $a)
                    @if(!empty($b->answer_content))
                        {{$b}}
                        <li>
                            <img src="{{asset($a->user->profile->avatar)}}">
                            <i class="Hui-iconfont">&#xe6ce;</i>
                            <a class="my" href="{{url('userCenter')}}/user={{$a->user_id}}"><span>{{$a->user->username}}</a> <span class="sp_gray">@了</span> <a href="{{url('userCenter')}}/user={{$a->another_id}}"><span>{{$a->another->username}}</a>:</span>
                            <span class="answer_time">at{{$a->created_at->diffForHumans()}}</span>
                            <p>{{$a->answer_content}}</p>
                            <span>于 <a href="{{url('topic')}}/topics={{$a->topic['id']}}">{{$a->topic->title}}</a></span>
                        </li>
                    @elseif($a->desc=='vote')
                        <li>
                            <img src="{{asset($a->user->profile->avatar)}}">
                            <i class="Hui-iconfont">&#xe697;</i>
                            <a class="my" href="{{url('userCenter')}}/user={{$a->user_id}}"><span>{{$a->user->username}}</a> <span class="sp_gray">赞了文章</span> <a
                                    href="{{url('topic')}}/topics={{$a->topic['id']}}">{{$a->topic->title}}</a></span>
                            <span class="answer_time">at{{$a->created_at->diffForHumans()}}</span>
                        </li>
                    @elseif($a->desc=='update_topic')
                        <li>
                            <img src="{{asset($a->user->profile->avatar)}}">
                            <i class="Hui-iconfont">&#xe692;</i>
                            <a class="my" href="{{url('userCenter')}}/user={{$a->user_id}}"><span>{{$a->user->username}}</a> <span class="sp_gray">修改了文章</span> <a
                                    href="{{url('topic')}}/topics={{$a->topic['id']}}">{{$a->topic->title}}</a></span>
                            <span class="answer_time">at{{$a->created_at->diffForHumans()}}</span>
                        </li>
                    @elseif($a->desc=='reply')
                        <li>
                            <img src="{{asset($a->user->profile->avatar)}}">
                            <i class="Hui-iconfont">&#xe622;</i>
                            <a class="my" href="{{url('userCenter')}}/user={{$a->user_id}}"><span>{{$a->user->username}}</a> <span class="sp_gray">评论了文章</span> <a
                                    href="{{url('topic')}}/topics={{$a->topic['id']}}">{{$a->topic->title}}</a></span>
                            <span class="answer_time">at{{$a->created_at->diffForHumans()}}</span>
                            <p>{{$a->reply_content}}</p>
                        </li>
                    @elseif($a->desc=='follow')
                        <li>
                            <img src="{{asset($a->user->profile->avatar)}}">
                            <i class="Hui-iconfont">&#xe649;</i>
                            <a class="my" href="{{url('userCenter')}}/user={{$a->user_id}}"><span>{{$a->user->username}}</a> <span class="sp_gray">关注了用户</span>
                            <a href="{{url('userCenter')}}/user={{$a->another_id}}"><span>{{$a->another->username}}</a>
                            <span class="answer_time">at{{$a->created_at->diffForHumans()}}</span>
                            <p>{{$a->reply_content}}</p>
                        </li>
                    @elseif($a->desc=='created_topic')
                        <li>
                            <img src="{{asset($a->user->profile->avatar)}}">
                            <i class="Hui-iconfont">&#xe647;</i>
                            <a class="my" href="{{url('userCenter')}}/user={{$a->user_id}}"><span>{{$a->user->username}}</a> <span class="sp_gray">发表了文章</span>
                            <a href="{{url('topic')}}/topics={{$a->topic['id']}}">{{$a->topic->title}}</a>
                            <span class="answer_time">at{{$a->created_at->diffForHumans()}}</span>
                        </li>
                    @endif
                @endforeach
                    <div class="remind_all all2">加载完毕~~</div>
            </ul>
            @else
            <div class="msg_none">
                暂无动态
            </div>
        @endif
    </div>
@endsection

@section('js')
    <script type="text/javascript">

    </script>
@endsection